
import http from '@ohos.net.http'
import axios from '@ohos/axios'
import { ProductTypeData } from '../../viewmodel/lead/ProductTypeData'

class FundTypeList {
  baseUrl: string = 'https://www.leadfund.com.cn/api/provider/product/type'


  getShopList(): Promise<ProductTypeData> {

    return new Promise((resolve, reject) => {
      axios.get(
        this.baseUrl
      ).then(resp => {
        if (resp.status === 200) {

          console.log('查询商铺信息成功！result:', resp.data.toString())
          resolve(JSON.parse(resp.data.toString()))
        } else {
          console.log('查询商铺信息失败！error:', JSON.stringify(resp))
          reject('查询商铺信息失败')
        }
      })

    })
  }
}

const  fundTypeList = new FundTypeList();
export default fundTypeList as FundTypeList;
